package de.baumann.browser.adapter

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import de.baumann.browser.OdinGlideModule
import de.baumann.browser.R
import de.baumann.browser.api.net.vo.duobao.JieXiao
import de.baumann.browser.utils.StringUtil

class JieXiaoAdapter : BaseQuickAdapter<JieXiao, BaseViewHolder>(R.layout.item_jiexiao) {
    override fun convert(helper: BaseViewHolder, item: JieXiao) {
        helper.setText(R.id.jiexiaoCode, "${item.phaseNum}期")
        helper.setText(R.id.jiexiaoTime, "开奖时间:${item.announceTime}")
        helper.setText(R.id.jiexiaoUserName, item.userName)
        helper.setText(R.id.jiexiaoOdinAddress, StringUtil.StrReplace(item.address))
        helper.setText(R.id.jiexiaofene, "本期参与份额 ${item.participationNum}")
        helper.setText(R.id.xinyunhaoma, "幸运号码 ${item.winNum}")
        val jiexiaoCover: ImageView = helper.getView(R.id.jiexiaoCover)
        OdinGlideModule.load(mContext, item.thumbnail, jiexiaoCover, R.drawable.shape_cover)
    }
}